<pre class="card card-block card-header mb-3">Model: {{selectedValue | json}}</pre>
<pre class="card card-block card-header mb-3">Selected option: {{selectedOption | json}}</pre>
<div>
    <input [(ngModel)]="selectedValue"
        [typeahead]="states"
        typeaheadOptionField="name"
        (typeaheadOnSelect)="onSelect($event)"
        (typeaheadOnPreview)="onPreview($event)"
        class="form-control">
    <div style="float:right;width:160px;"
         class="card card-block card-header mb-3">
        Preview region:
        <span *ngIf="previewOption; else noPreviewOption">{{previewOption?.region}}</span>
        <ng-template #noPreviewOption><span>N/A</span></ng-template>
    </div>
</div>
